<script setup>
import {useRoute} from 'vue-router'
import {inject, ref} from 'vue'
import {Menu} from '@element-plus/icons-vue'

const route=useRoute()
const path_list=inject('path_list')
path_list.value=route.matched

</script>
<template>
<el-menu class="menu" mode="horizontal" :default-active="$route.path" :router="true" :ellipsis="false">
    <el-menu-item index="/admin/center">
        <div style="display:flex; align-items: center;">
            <el-icon><Menu /></el-icon>
            <span>管理中心</span>
        </div>
    </el-menu-item>
    <el-menu-item index="/admin/rate">评分系统</el-menu-item>
    <el-sub-menu index="/admin/meta">
        <template #title>元数据管理</template>
        <el-menu-item index="/admin/meta_rate">评价细则</el-menu-item>
        <el-menu-item index="/admin/meta_organization">组织信息</el-menu-item>
    </el-sub-menu>
</el-menu>
<router-view name="admin"/>
</template>
<style lang="scss" scoped>
.menu{
    width:100%;
}
.el-menu--horizontal > .el-menu-item:nth-child(1) {
    margin-right: auto;
}
</style>